//
//  CommonAction.h
//  quxiangtao
//
//  Created by xbmios on 2018/8/14.
//  Copyright © 2018年 shanhaijin. All rights reserved.
//

#import <Foundation/Foundation.h>


typedef void(^PhoneCodeBlock)(NSString *codeStr);
typedef void (^DlReturnBlock)(id result);

@interface CommonAction : NSObject
/**
 * 创建商品真实ID或者混淆(open)ID对应的详情页面
 * @param itemId   商品真实ID或者混淆(open)ID
 */
//@property (copy, nonatomic) NSString *itemDetailPage;
/**
 * applink使用，优先拉起的linkKey，手淘：@"taobao_scheme"
 */
@property(nonatomic, copy) NSString *linkType;


+ (CommonAction *)sharedInstance;

// 判断用户是否登录
- (BOOL)isLoginWithParentVc:(UIViewController *)parentVC;

// 手淘/天猫首次授权登录 并跳转对应商品的详情页
- (void)authWithViewController:(UIViewController *)vc andItemDetailPage:(NSString *)itemDetailPage;
// 跳转淘宝客户端详情页
- (void)goToTbGoodsDetailWith:(UIViewController *)vc itemDetailPage:(NSString *)itemDetailPage ;
// 淘宝订单
- (void)showCartOrOrderListWith:(UIViewController *)vc;

// 淘宝购物车
- (void)showCartListWithVC:(UIViewController *)vc;

// 友盟分享
- (void)sharedWithDict:(NSDictionary *)dict withController:(UIViewController *)controller;

// 弹框
- (void)alertViewWith:(NSString *)title description:(NSString *)des andBtns:(NSArray *)btnArr withParentVC:(UIViewController *)parentVC;

// 获取验证码
- (void)getCodeWithPhone:(NSString *)phoneNum type:(NSString *)type andSender:(UIButton *)sender phoneCodeBlock:(PhoneCodeBlock)codeBlock;

// 获取用户信息
- (void)getUserInfoWithBlock:(DlReturnBlock)result;

// 支付宝支付
- (void)goAlipayWithRsa2PrivateKey:(NSString *)privateKey;

// 支付购买接口
- (void)gotoPay:(NSString *)par type:(NSInteger)type andReturnBlock:(DlReturnBlock)result;

// 初始化接口（用户访问记录）
- (void)userVisitRecordWithRoute:(NSString *)routeStr;

@end
